package com.hjh.gameforum.mapper;

import com.hjh.gameforum.entity.User;
import org.apache.ibatis.annotations.Mapper;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface UserMapper {
    //检查用户名是否存在
    User getUserByName(String username);
    //检查邮箱是否存在
    User getUserByEmail(String email);
    //保存用户
    void save(User user);

    void updateUser(User user);

    User getUserById(Long userId);

    List<User> getUserList();

    List<User> searchUser(String username);

    void deleteUser(Long userId);

    int countByDate(LocalDate date);

    int countByDateRange(LocalDate start, LocalDate end);

    int countByMonth(int year, int month);

    int ActiveCount(LocalDate date);

    Long getTotalUsers();

    User getUserByPhone(String phone);
}
